package com.example.demo.auto.controller;

import com.beiding.businessplatform.request.R;
import com.beiding.businessplatform.request.Requester;
import com.example.demo.auto.model.A;
import com.example.demo.manual.service.AService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/a")
public class AController {

    @Autowired
    private AService service;

    /*
        修改 A 的名称
     */
    @PostMapping("/change-name")
    R changeName(@RequestBody(required = true) String body) {
        Requester<A> requester = new Requester<>(body, A.class);
        service.changeName(requester);
        return requester.getR();
    }

}
